#ifdef ESP32
#include <WiFi.h>
#include <WiFiMulti.h>
WiFiMulti wifiMulti;

#else
#include <ESP8266WiFiMulti.h>

ESP8266WiFiMulti wifiMulti;
#endif

void setup()
{
    Serial.begin(115200);
    delay(10);

    wifiMulti.addAP("MiHome", "ftwc1982");
    wifiMulti.addAP("HUAWEI", "21937603");
    wifiMulti.addAP("ssid_from_AP_3", "your_password_for_AP_3");

    Serial.println("Connecting Wifi...");
    if (wifiMulti.run(10000) == WL_CONNECTED)
    {
        Serial.println("");
        Serial.println("WiFi connected");
        Serial.println("IP address: ");
        Serial.println(WiFi.localIP());
    }
}

void loop()
{
    if (wifiMulti.run() != WL_CONNECTED)
    {
        Serial.println("WiFi not connected!");
        delay(1000);
    }
}
